package o.mrs;


import org.json.JSONObject;

import android.R.integer;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class Person extends Activity {
	
	 private TextView usuario;
	 private TextView genero;
	 private TextView edad;
	 private TextView cumple;
	 @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.person);
	        
	        Bundle bolsa = getIntent().getExtras();
	        String uri = bolsa.getString("URI");
	        String uriFull ="person/"+uri;
	        
	        try {
				String obj = ApiRest.getRequestGet(uriFull);
				JSONObject jsonObject = new JSONObject(obj);
				
			
	     		String uuid = (String) jsonObject.get("display");  
	     		usuario = (TextView) findViewById(R.id.personName);
	     	    usuario.setText(uuid);
	     		
	     	    String gender = (String) jsonObject.get("gender"); 
	     	    genero = (TextView) findViewById(R.id.personGenere);
	     	    genero.setText(gender);
	     	 	     	    
	     	    int age =Integer.parseInt((String) jsonObject.get("age"));
	     	    edad = (TextView)findViewById(R.id.personAge);
	     		edad.setText("hola");
	     	    
	     		String birthdate = (String) jsonObject.get("birthdate");  
	     		cumple = (TextView) findViewById(R.id.personDate);
	     		cumple.setText(birthdate);
	     			  
	     	
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	        
	 }
	
}
